package TCP4;

import java.io.*;
import java.net.Socket;

public class Mythread extends Thread {
    private Socket socket;
    public Mythread(Socket socket) {
        this.socket = socket;
    }
    @Override
    public void run() {
            try {
               OutputStream out = socket.getOutputStream();
               PrintStream ps = new PrintStream(out);
               ps.println("HTTP/1.1 200 OK");
               ps.println("Content-Type: text/html");
               ps.println();
               ps.println("<html><body><h1>Hello World!I am LuoYe</h1></body></html>");
               ps.close();
               socket.close();
            } catch (Exception e) {
                e.printStackTrace();
            }


        // Do something with the socket here
    }
}
